import axios from 'axios'
import { get } from '@/utils/request'

export default {
  list: query => {
    console.log('发送到后端的参数:', query)
    return axios.get('/api/admin/application/list', {
      params: query,
      paramsSerializer: params => {
        return Object.keys(params)
          .filter(key => params[key] != null)
          .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
          .join('&')
      }
    })
  },
  updateStatus: (id, status) => axios.put(`/api/admin/application/${id}/status`, null, { params: { status } })
}
